/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Leoz
 */
@Embeddable
public class SongPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "idSong")
    private int idSong;
    @Basic(optional = false)
    @Column(name = "Artist_idArtist")
    private int artistidArtist;

    public SongPK() {
    }

    public SongPK(int idSong, int artistidArtist) {
        this.idSong = idSong;
        this.artistidArtist = artistidArtist;
    }

    public int getIdSong() {
        return idSong;
    }

    public void setIdSong(int idSong) {
        this.idSong = idSong;
    }

    public int getArtistidArtist() {
        return artistidArtist;
    }

    public void setArtistidArtist(int artistidArtist) {
        this.artistidArtist = artistidArtist;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idSong;
        hash += (int) artistidArtist;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SongPK)) {
            return false;
        }
        SongPK other = (SongPK) object;
        if (this.idSong != other.idSong) {
            return false;
        }
        if (this.artistidArtist != other.artistidArtist) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.SongPK[ idSong=" + idSong + ", artistidArtist=" + artistidArtist + " ]";
    }
    
}
